#spawns in the beds, since MC-123836 prevents them from beeing set with structure blocks



execute at @p run loot spawn ~ ~-30 ~ loot ercerus:random/ship_beds



#brown beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~5 63 ~17 minecraft:brown_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~6 63 ~17 minecraft:brown_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~5 63 ~19 minecraft:brown_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~6 63 ~19 minecraft:brown_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~5 63 ~21 minecraft:brown_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~5 63 ~22 minecraft:brown_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~3 63 ~21 minecraft:brown_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_brown}}}] run setblock ~3 63 ~22 minecraft:brown_bed[facing=south,part=head]



#yellow beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~5 63 ~17 minecraft:yellow_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~6 63 ~17 minecraft:yellow_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~5 63 ~19 minecraft:yellow_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~6 63 ~19 minecraft:yellow_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~5 63 ~21 minecraft:yellow_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~5 63 ~22 minecraft:yellow_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~3 63 ~21 minecraft:yellow_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_yellow}}}] run setblock ~3 63 ~22 minecraft:yellow_bed[facing=south,part=head]



#red beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~5 63 ~17 minecraft:red_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~6 63 ~17 minecraft:red_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~5 63 ~19 minecraft:red_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~6 63 ~19 minecraft:red_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~5 63 ~21 minecraft:red_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~5 63 ~22 minecraft:red_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~3 63 ~21 minecraft:red_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_red}}}] run setblock ~3 63 ~22 minecraft:red_bed[facing=south,part=head]



#orange beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~5 63 ~17 minecraft:orange_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~6 63 ~17 minecraft:orange_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~5 63 ~19 minecraft:orange_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~6 63 ~19 minecraft:orange_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~5 63 ~21 minecraft:orange_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~5 63 ~22 minecraft:orange_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~3 63 ~21 minecraft:orange_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_orange}}}] run setblock ~3 63 ~22 minecraft:orange_bed[facing=south,part=head]



#light_blue beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~5 63 ~17 minecraft:light_blue_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~6 63 ~17 minecraft:light_blue_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~5 63 ~19 minecraft:light_blue_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~6 63 ~19 minecraft:light_blue_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~5 63 ~21 minecraft:light_blue_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~5 63 ~22 minecraft:light_blue_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~3 63 ~21 minecraft:light_blue_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_blue}}}] run setblock ~3 63 ~22 minecraft:light_blue_bed[facing=south,part=head]



#cyan beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~5 63 ~17 minecraft:cyan_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~6 63 ~17 minecraft:cyan_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~5 63 ~19 minecraft:cyan_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~6 63 ~19 minecraft:cyan_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~5 63 ~21 minecraft:cyan_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~5 63 ~22 minecraft:cyan_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~3 63 ~21 minecraft:cyan_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_cyan}}}] run setblock ~3 63 ~22 minecraft:cyan_bed[facing=south,part=head]



#blue beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~5 63 ~17 minecraft:blue_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~6 63 ~17 minecraft:blue_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~5 63 ~19 minecraft:blue_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~6 63 ~19 minecraft:blue_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~5 63 ~21 minecraft:blue_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~5 63 ~22 minecraft:blue_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~3 63 ~21 minecraft:blue_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_blue}}}] run setblock ~3 63 ~22 minecraft:blue_bed[facing=south,part=head]



#black beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~5 63 ~17 minecraft:black_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~6 63 ~17 minecraft:black_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~5 63 ~19 minecraft:black_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~6 63 ~19 minecraft:black_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~5 63 ~21 minecraft:black_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~5 63 ~22 minecraft:black_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~3 63 ~21 minecraft:black_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_black}}}] run setblock ~3 63 ~22 minecraft:black_bed[facing=south,part=head]



#green beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~5 63 ~17 minecraft:green_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~6 63 ~17 minecraft:green_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~5 63 ~19 minecraft:green_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~6 63 ~19 minecraft:green_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~5 63 ~21 minecraft:green_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~5 63 ~22 minecraft:green_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~3 63 ~21 minecraft:green_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_green}}}] run setblock ~3 63 ~22 minecraft:green_bed[facing=south,part=head]



#lime beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~5 63 ~17 minecraft:lime_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~6 63 ~17 minecraft:lime_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~5 63 ~19 minecraft:lime_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~6 63 ~19 minecraft:lime_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~5 63 ~21 minecraft:lime_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~5 63 ~22 minecraft:lime_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~3 63 ~21 minecraft:lime_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_lime}}}] run setblock ~3 63 ~22 minecraft:lime_bed[facing=south,part=head]



#light_gray beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~5 63 ~17 minecraft:light_gray_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~6 63 ~17 minecraft:light_gray_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~5 63 ~19 minecraft:light_gray_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~6 63 ~19 minecraft:light_gray_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~5 63 ~21 minecraft:light_gray_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~5 63 ~22 minecraft:light_gray_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~3 63 ~21 minecraft:light_gray_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_light_gray}}}] run setblock ~3 63 ~22 minecraft:light_gray_bed[facing=south,part=head]



#gray beds
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~5 63 ~17 minecraft:gray_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~6 63 ~17 minecraft:gray_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~5 63 ~19 minecraft:gray_bed[facing=east,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~6 63 ~19 minecraft:gray_bed[facing=east,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~5 63 ~21 minecraft:gray_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~5 63 ~22 minecraft:gray_bed[facing=south,part=head]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~3 63 ~21 minecraft:gray_bed[facing=south,part=foot]
execute as @e[type=item,limit=1,sort=random,nbt={Item:{tag:{rnd:bed_gray}}}] run setblock ~3 63 ~22 minecraft:gray_bed[facing=south,part=head]



kill @e[type=item,limit=1,nbt={Item:{tag:{bed:1}}}]